home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Tutorial
/
Cookbook
/
13.pie_slice
/
PieView.m
< prev
next >
Wrap
Text File
|
1995-06-12
|
797b
|
50 lines
/* Generated by Interface Builder */
#import "PieView.h"
#import <dpsclient/wraps.h>
#import <appkit/Font.h>
#import <appkit/Control.h>
#import "slice.h"
#import "math.h"
@implementation PieView
+newFrame:(const NXRect *)tF
{
self = [super newFrame:tF];
[self translate:bounds.size.width/2.0 :bounds.size.height/2.0];
myLabel = "";
return self;
}
- getSlider:sender
{
myFloat = [sender floatValue];
[self display];
return self;
}
- setMyText:anObject
{
myText = anObject;
return self;
}
- getLabel:sender
{
myLabel = [myText stringValue];
[self display];
return self;
}
- drawSelf:(NXRect*)r :(int)c
{
NXEraseRect(&bounds);
PSselectfont("Helvetica", 16.0);
drawSlice(0.5, 80.0, 0.0, myFloat, 20.0, myLabel);
return self;
}
@end